<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户信息</title>
		<link rel='stylesheet' type='text/css' href='/static/view/css/common.css'/>
		<link rel='stylesheet' type='text/css' href='/static/view/css/head.css'/>
                <style type="text/css">
                    input{
                        border: 1px solid #BDD7E3;height: 25px;
                    }
                </style>
	</head>
	<body>
		<include file="public:header"/>
                
		<div class='body'>
			<span class='title'>用户信息</span>
			<div  class="body-infor" style="width:700px;" id="user-info">
			<fieldset>
                            <legend><h3>个人资料</h3></legend>
                            <form action="/User/user/userEdit" method="post">
                                <table width="700px;" border="1px" cellspacing="0px" style="border: 1px solid #BDD7E3;">
                                    <tr>
                                        <th><label for="head-img">头像</label></th>
                                        <td colspan="3"><a href="#"><img src="{$user.head_img}" width="80px" id="head-img"/></a></td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                         <div id="img-list" style="display: none;">
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/001.jpg"/><img src="/static/view/image/head-img/001.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/002.jpg"/><img src="/static/view/image/head-img/002.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/003.jpg"/><img src="/static/view/image/head-img/003.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/004.jpg"/><img src="/static/view/image/head-img/004.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/005.jpg"/><img src="/static/view/image/head-img/005.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/006.jpg"/><img src="/static/view/image/head-img/006.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/007.jpg"/><img src="/static/view/image/head-img/007.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/008.jpg"/><img src="/static/view/image/head-img/008.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/009.jpg"/><img src="/static/view/image/head-img/009.jpg" width="60px;"/><br/>
                                            <!--<input name="head_img" type="radio" value="/static/view/image/head-img/010.jpg"/><img src="/static/view/image/head-img/010.jpg" width="60px;"/>-->
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/011.jpg"/><img src="/static/view/image/head-img/011.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/012.jpg"/><img src="/static/view/image/head-img/012.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/013.jpg"/><img src="/static/view/image/head-img/013.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/014.jpg"/><img src="/static/view/image/head-img/014.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/015.jpg"/><img src="/static/view/image/head-img/015.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/016.jpg"/><img src="/static/view/image/head-img/016.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/017.jpg"/><img src="/static/view/image/head-img/017.jpg" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/018.gif"/><img src="/static/view/image/head-img/018.gif" width="60px;"/>
                                            <input name="head_img" type="radio" value="/static/view/image/head-img/default.jpg"/><img src="/static/view/image/head-img/default.jpg" width="60px;"/>
                                         </div>   
                                        </td>
                                    </tr>
                                    <tr>
                                        <th><label for="uid">用户ID</label></th>
                                        <td><input readonly name="id" value="{$user.id}" id="uid" style="border: 0px solid #BDD7E3"></td>
                                        <th><label for="name">姓名</label></th>
                                        <td><input readonly id='name'  type='text' name='name'  value='{$user.name}' /></td>
                                    </tr>
                                    <tr>
                                        <th><label for="username">用户名</label></th>
                                        <td>{$user.username}</td>
                                        <th><label for="gender">性别</label></th>
                                        <td>
                                            <div id="gender">{$user.gender}</div>
                                            <div id="gender-radio" style="display: none;">
                                                <if condition="$user.gender eq '男'">
                                                    <input readonly name="gender" value='男' type="radio" checked="checked"/>男
                                                    <input readonly  name="gender" value='女' type="radio"/>女
                                                <else/>
                                                    <input readonly  name="gender" value='男' type="radio"/>男
                                                    <input readonly  name="gender" value='女' type="radio" checked="checked"/>女
                                                </if>
                                            </div> 
                                        </td>
                                    </tr>
                                    <tr>
                                        <th><label for="credits">积分</label></th>
                                        <td>{$user.credits}</td>
                                        <th><label for="birth-day">出生年月</label></th>
                                        <td><input readonly id="birth-day" name="birth_day" value='{$user.birth_day}' type="date" placeholder="yyyy-mm-dd"/></td>
                                    </tr>
                                    <tr>
                                        <th><label for="group">群组</label></th>
                                        <td>{$user.role}</td>
                                        <th><label for="address">地址</label></th>
                                        <td><input readonly id="address" name="address" value='{$user.address}' type="text" /></td>
                                    </tr>
                                    <tr>
                                        <th><label for="email">邮箱</label></th>
                                        <td><input readonly id="email" name="email" value='{$user.email}' type="text" /></td>
                                        <th><label for="profession">职业</label></th>
                                        <td><input readonly id="profession" name="profession" value='{$user.profession}' type="text"/></td>
                                    </tr>
                                    <tr>
                                        <th><label for="phone">电话</label></th>
                                        <td><input readonly id="phone" name="phone" value='{$user.phone}' type="text" /></td>
                                        <th><label for="register-time">注册时间</label></th>
                                        <td>{$user.register_time}</td>
                                    </tr>
                                    <if condition="$user.id eq $_SESSION['userInfo']['id']">
                                        <tr>
                                            <th>修改资料</th>
                                            <td colspan="1">
                                                <button type="button" id="edit" style="display: block">编辑</button>
                                                <button type="submit" id="submit" style="display: none">提交</button>
                                                <php>if($_GET['flag']==error){echo "<font color='red'>未进行任何更改</font>";}</php>
                                            </td> 
                                            <th>修改密码</th>
                                            <td colspan="2"><a href="/User/user/changePassword?user_id={$user.id}"><button type="button">修改密码</button></a></td>
                                        </tr>
                                        <else/> 
                                    </if>
                                </table>
                            </form>
			</fieldset>
			</div>
	
		</div>
	
	<include file="public:footer"/>
        
	<script type='text/javascript' src='/static/view/js/jquery-1.8.3.js'></script>
	<script type='text/javascript'>
                function fleshVerify(){ 
                      //重载验证码
                      var time = new Date().getTime();//alert(time);
                      document.getElementById('verifyImg').src= '/User/public/verify/'+time;
                 }
		$(document).ready(function(){
                        $('#edit').click(function(){
                            $('input').attr('readonly',false);
                            $('#uid').attr('readonly',true);
                            $(this).css('display','none');
                            $('#gender').css('display','none');
                            $('#gender-radio').css('display','block');
                            $('#submit').css('display','block');
                        });
                        $('.title').click(function(){
                           $('div.body-infor').slideToggle('slow');
                       });

                        $('legend').click(function(){
                          $(this).next('form').slideToggle('fast');
                      });
                        $('#head-img').click(function(){
                            $('#img-list').slideToggle('slow');
                        });
                      
		});
	
	</script>
	</body>
</html>